package com.example.mapper;

import com.example.entity.Admin;
import com.example.entity.Advice;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface AdviceMapper {
    @Select("SELECT * FROM student_advice")
    List<Advice> finAll();


//    List<Advice> findAllByidinfo(String stu_num,String info);

    int update(Advice advice);

    int insert(Advice advice);

    @Delete("DELETE FROM advice WHERE advice_id = #{advice_id}")
    Integer deleteBy(Integer advice_id);


    List<Advice> selectPage(Integer pageNum, Integer pageSize, String stu_num);

    Integer selectTotal(String stuNum);

    @Select("SELECT * FROM advice where advice_id=#{advice_id}")
    List<Advice> findByid(String advice_id);
}
